Если вы импортируете модуль, который уже был импортирован, ничего не произойдёт, так как Python отслеживает, какие модули уже были загружены. Все такие модули помещаются в словарь sys.modules:
In : import sys In : 'sys' in sys.modules.keys() Out: True
Если вам действительно нужно перезагрузить модуль, следует использовать функцию importlib.reload(m). Здесь m — это объект модуля, который был успешно импортирован ранее, а не строка с его именем:
In : import importlib In : importlib.reload(importlib) Out[5]: <module 'importlib' from '/home/bookpython/.ve/pythonetc/lib/python3.6/importlib/__init__.py'>
Если вы импортируете модуль, который уже был импортирован, ничего не произойдёт, так как Python отслеживает, какие модули уже были загружены. Все такие модули помещаются в словарь sys.modules:
In : import sys In : 'sys' in sys.modules.keys() Out: True
Если вам действительно нужно перезагрузить модуль, следует использовать функцию importlib.reload(m). Здесь m — это объект модуля, который был успешно импортирован ранее, а не строка с его именем:
In : import importlib In : importlib.reload(importlib) Out[5]: <module 'importlib' from '/home/bookpython/.ve/pythonetc/lib/python3.6/importlib/__init__.py'>
To pay the bills, Mr. Durov is issuing investors $1 billion to $1.5 billion of company debt, with the promise of discounted equity if the company eventually goes public, the people briefed on the plans said. He has also announced plans to start selling ads in public Telegram channels as soon as later this year, as well as offering other premium services for businesses and users.
Telegram has exploded as a hub for cybercriminals looking to buy, sell and share stolen data and hacking tools, new research shows, as the messaging app emerges as an alternative to the dark web.An investigation by cyber intelligence group Cyberint, together with the Financial Times, found a ballooning network of hackers sharing data leaks on the popular messaging platform, sometimes in channels with tens of thousands of subscribers, lured by its ease of use and light-touch moderation.Библиотека Python разработчика | Книги по питону from vn